package com.qyhl.webtv.module_circle.circle.usercenter;


import com.qyhl.webtv.commonlib.entity.circle.CircleHomeBean;
import com.qyhl.webtv.commonlib.entity.circle.CircleUCenterBean;

import java.util.List;

/**
 * Created by qyhl on 2018/1/24.
 */

public class CircleUserPresenter implements CircleUserContract.CircleUserPresenter {
    private CircleUserModel mModel;
    private CircleUserActivity mView;

    public CircleUserPresenter(CircleUserActivity mView) {
        this.mView = mView;
        this.mModel = new CircleUserModel(this);
    }

    @Override
    public void getCenterInfo(String username, String dstUsername, String lastId) {
        mModel.getCenterInfo(username, dstUsername, lastId);
    }

    @Override
    public void getMoreInfo(String username, String dstUsername, String lastId) {
        mModel.getMoreInfo(username, dstUsername, lastId);
    }

    @Override
    public void doBlock(String dstUsername) {
        mModel.doBlock(dstUsername);
    }

    @Override
    public void undoBlock(String dstUsername) {
        mModel.undoBlock(dstUsername);
    }

    @Override
    public void getSuccess(CircleUCenterBean bean) {
        mView.getSuccess(bean);
    }

    @Override
    public void setMoreInfo(List<CircleHomeBean> beanList) {
        mView.setMoreInfo(beanList);
    }

    @Override
    public void getError(int code, String msg) {
        switch (code) {
            case 0:
                mView.getNetError(msg);
                break;
            case 1:
                mView.getError(msg);
                break;
            case 2:
                mView.showMessage(msg);
                break;
            case 3:
                mView.showLog(msg);
                break;
            default:
                break;
        }
    }

    @Override
    public void doFollow(String dstUserName) {
        mModel.doFollow(dstUserName);
    }

    @Override
    public void undoFollow(String dstUserName) {
        mModel.undoFollow(dstUserName);
    }

    @Override
    public void followSuccess(String msg) {
        mView.followSuccess(msg);
    }

    @Override
    public void followError(String msg) {
        mView.followError(msg);
    }

    @Override
    public void unFollowSuccess(String msg) {
        mView.unFollowSuccess(msg);
    }

    @Override
    public void unFollowError(String msg) {
        mView.unFollowError(msg);
    }

    @Override
    public void blockSuccess(String msg) {
        mView.blockSuccess(msg);
    }

    @Override
    public void blockError(String msg) {
        mView.blockError(msg);
    }

    @Override
    public void unBlockSuceess(String msg) {
        mView.unBlockSuceess(msg);
    }

    @Override
    public void unBlockError(String msg) {
        mView.unBlockError(msg);
    }

    @Override
    public void checkShield(String dstUsername) {
        mModel.checkShield(dstUsername);
    }

    @Override
    public void checkResult(int code, String msg) {
        switch (code) {
            case 0:
                mView.checkUnPass(msg);
                break;
            case 1:
                mView.checkPass();
                break;
            default:
                break;
        }
    }
}
